package com.hg.avaya.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.avaya.runtime.platforms.Toolkit;
import com.avaya.sce.runtime.perf.Performance;
import com.avaya.sce.runtimecommon.IPerformanceTracker;
import com.avaya.sce.runtimecommon.SCESession;

/**
 * @author litong
 * @date 2019-3-31
 *
 */
public class SCEServletCopy extends HttpServlet {
  private void requestHandler(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    SCESession mySession = null;
    String platform = getServletContext().getInitParameter("runtime-Platform");
    mySession = SCESession.getSession(request, response, this, Toolkit.getPlatformClientToolkit(platform)); // 不知道是什么意思
    IPerformanceTracker tracker = mySession.getPerformanceTracker();
    if (tracker == null) {
      mySession.setPerformanceTracker(new IPerformanceTracker() {
        public void update(String type, long time, String id) {
          Performance.update(type, time, id);
        }
      });
    }
  }
}
